//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.jim.server.config;

import org.jim.core.cache.redis.RedisConfig;
import org.jim.core.http.HttpConfig;
import org.jim.core.ws.WsConfig;
import org.jim.server.listener.ImServerListener;

public abstract class ImServerConfigBuilder<T extends ImServerConfig, B extends ImServerConfigBuilder> {
	protected T conf;
	protected ImServerListener serverListener;
	protected HttpConfig httpConfig;
	protected WsConfig wsConfig;
	protected RedisConfig redisConfig;

	public ImServerConfigBuilder() {
	}

	public abstract B configHttp(HttpConfig var1) throws Exception;

	public abstract B configWs(WsConfig var1) throws Exception;

	public abstract B configRedis(RedisConfig var1) throws Exception;

	protected abstract B getThis();

	public B serverListener(ImServerListener serverListener) {
		this.serverListener = serverListener;
		return this.getThis();
	}

	public T build() throws Exception {
		this.httpConfig = HttpConfig.newBuilder().build();
		this.wsConfig = WsConfig.newBuilder().build();
		this.configHttp(this.httpConfig);
		this.configWs(this.wsConfig);
		this.configRedis(new RedisConfig());
		return this.conf;
	}
}
